package com.learn.hibernatevalidator.chapter05.groupredefined;

import jakarta.validation.GroupSequence;
import jakarta.validation.constraints.AssertFalse;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author: liyf
 * @create: 2025-01-05 22:15
 **/
@EqualsAndHashCode(callSuper = true)
@GroupSequence({
        RentalChecks.class,
        CarChecks.class,
        RentalCar.class
})
@Data
public class RentalCar extends Car {

    @AssertFalse(message = "The car is currently rented out", groups = RentalChecks.class)
    private boolean rented;

    public RentalCar(String manufacturer, String licencePlate, int seatCount) {
        super(manufacturer, licencePlate, seatCount);
    }
}
